﻿<%@ WebHandler Language="C#" Class="control" %>

using System;
using System.Web;
using System.Collections.Generic;
using System.Collections.Specialized;

public class control : IHttpHandler
{
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        NameValueCollection queryString = context.Request.QueryString;
        string account = context.Request.QueryString["account"];
        AccountStatisticsProxy proxy = new AccountStatisticsProxy();

        string json = proxy.GetOneWeekAccountStatistics(account);
        if(json != "")
        {
            context.Response.Write(Message.CreateMessage(true, json));
        }
        else
        {
            context.Response.Write(Message.CreateMessage(false, "No record!"));
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}